package com.ywjt.platformbusiness.classify.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.classify.model.DesignerModel;
import com.ywjt.platformbusiness.store.model.StoreSecondClassifyModel;

import java.util.List;

public class ClassifyDesignerAdapter extends BaseQuickAdapter<DesignerModel.ResultDTO, BaseViewHolder> {

    public ClassifyDesignerAdapter(@Nullable List<DesignerModel.ResultDTO> data) {
        super(R.layout.item_classify_goods, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DesignerModel.ResultDTO item) {
        ImageView ivGoodsImg=helper.getView(R.id.ivGoodsImg);
       Glide.with(mContext).load(item.getShopLogo())
               .placeholder(R.mipmap.default_image)
               .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
               .into(ivGoodsImg);

        helper.setText(R.id.tvGoodName,item.getShopName());
    }
}
